package calendarInterface2;


import javax.swing.JOptionPane;

/**
 * @author Mohamed Ali Ayed
 */
@SuppressWarnings("serial")
public class OPError extends JOptionPane {

	//**************************************************************
	// Method: OPError
	// Description: Class constructor
	//**************************************************************
	/**
	 * 
	 */
	
	//Error message
	public final String NO_AGENDA_SELECTED_MSG ="You must select a agenda before adding an event.";
	public final String NO_DESC_OR_NAME_ENTERED ="Enter a name and a description for your event.";
	public final String NO_STARTDATE_OR_ENDDATE_ENTERED ="Enter a starting and ending date for the event. (must be the same date)";
	public final String END_TIME_BEFORE_START_TIME ="The start time must be before the end time.";
	public final String AGENDA_DONT_EXIST="Agenda doesn't exist (something went wrong).";
	public final String EVENT_DONT_EXIST="Event doesn't exist (something went wrong).";
	public final String CANT_UPDATE_ERROR ="Can't update the database, try reconnecting.";
	public final String ALREADY_AN_EVENT ="There is already an event at this date.";
	
	//Title of error frame
	public final String ERROR_FRAME = "ERROR";
	public final String UPDATE_FRAME = "UPDATE ERROR";
	public final String CONNECTION_FRAME = "CONNECTION ERROR";
	
	public OPError() {
		
	}
	
	//**************************************************************
	// Method: showErrorWindow
	// Description: Displays an error window
	//**************************************************************
	/**
	 * @param p_sMessage
	 * 		Message to be displayed
	 * @param p_sTitle
	 * 		Title of the window
	 */
	public void showErrorWindow(String p_sMessage, String p_sTitle) {
		JOptionPane.showMessageDialog(null, p_sMessage, p_sTitle, JOptionPane.ERROR_MESSAGE);
	} // showErrorWindow()
	
	//**************************************************************
	// Method: showInformationWindow
	// Description: Displays an information window
	//**************************************************************
	/**
	 * @param p_sMessage
	 * 		Message to be displayed
	 * @param p_sTitle
	 * 		Title of the window
	 */
	public void showInformationWindow(String p_sMessage, String p_sTitle) {
		JOptionPane.showMessageDialog(null, p_sMessage, p_sTitle, JOptionPane.INFORMATION_MESSAGE);
	}

}
